#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using pii = pair<int, int>;

const int MAXN = 2e5 + 5;
const int MOD = 998244353;

string s;

ll qpow(ll a, ll b) {
    ll res = 1;
    while (b) {
        if (b & 1) res = res * a % MOD;
        a = a * a % MOD;
        b >>= 1;
    }
    return res;
}
int main() {
#ifdef LOCAL
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif
    ios::sync_with_stdio(false), cin.tie(0);
    cin >> s;

    int n = s.size();
    ll res = 0;
    ll inv8 = qpow(8, MOD - 2);

    for (int i = n - 1; i >= 0; i--) {
        int x = s[i] - '0';
        int k = n - i;

        ll a = 9 * qpow(5, k - 1) % MOD;
        a = (a - 1 + MOD) % MOD;
        a = a * x % MOD;
        a = a * inv8 % MOD;

        res = (res + a) % MOD;
    }
    res = res * qpow(2, n - 1) % MOD;
    cout << res << endl;
    return 0;
}